<!DOCTYPE html>
<html>
<head>
<title>优惠券</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/AdminLTE.min.css">
<link rel="stylesheet" href="../../css/font-awesome.min.css">
<link rel="stylesheet" href="../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
<link rel="stylesheet" href="../../plugins/jqfileupload/css/jquery.fileupload.css">
<link rel="stylesheet" href="../../plugins/ztree/css/metroStyle/metroStyle.css">
<link rel="stylesheet" href="../../plugins/bootstrap-table/bootstrap-table.min.css">
<link href="../../plugins/datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<link rel="stylesheet" href="../../css/all-skins.min.css">
<link rel="stylesheet" href="../../css/main.css">
<script src="../../libs/jquery.min.js"></script>
<script src="../../plugins/layer/layer.js"></script>
<script src="../../libs/bootstrap.min.js"></script>
<script src="../../libs/vue.min.js"></script>
<script src="../../plugins/jqgrid/grid.locale-cn.js"></script>
<script src="../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
<script src="../../plugins/ztree/jquery.ztree.all.min.js"></script>
<script src="../../plugins/ueditor/ueditor.config.js"></script>
<script src="../../plugins/ueditor/ueditor.all.min.js"></script>
<script src="../../plugins/jqfileupload/js/vendor/jquery.ui.widget.js"></script>
<script src="../../plugins/jqfileupload/js/jquery.iframe-transport.js"></script>
<script src="../../plugins/jqfileupload/js/jquery.fileupload.js"></script>
<script src="../../libs/app.js"></script>
<script src="../../plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="../../plugins/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="../../plugins/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../../js/components.js"></script>
<script src="../../js/common.js"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div id="rrapp" class="wrapper" v-cloak>

<main-header></main-header> 
  <main-sidebar></main-sidebar>
  <!-- =============================================== -->
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <content-header title="优惠券管理"></content-header>
    
    <!-- Main content -->
    <section class="content">
	<div v-show="showList">
		<div class="box">
			<div class="box-header with-border">
              <h3 class="box-title">列表</h3>
            </div><!-- /.box-header -->
            <div class="box-body">
				<div class="grid-btn">
					<div class="form-group col-sm-2">
						<input type="text" class="form-control" v-model="q.couponName" @keyup.enter="query" placeholder="优惠券名称">
					</div>
					<a class="btn btn-default" @click="query">查询</a>
					<a v-if="hasPermission('coupon:save')" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
					<a v-if="hasPermission('coupon:delete')" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
				</div>
			    <table id="table"></table>
			</div>
		</div>
    </div>
    
    <div v-show="!showList">
		<div class="box">
			<div class="box-header with-border">
              <h3 class="box-title">{{title}}</h3>
            </div><!-- /.box-header -->
            <div class="box-body">
		<form class="form-horizontal">
			<div class="form-group">
			   	<div class="col-sm-2 control-label">名称</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="coupon.couponName" placeholder="名称"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">开始时间</div>
			   	<div class="col-sm-10">
			      <input id="start" type="text" class="form-control" v-model="coupon.beginTime" placeholder="开始时间"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">结束时间</div>
			   	<div class="col-sm-10">
			      <input id="end" type="text" class="form-control" v-model="coupon.endTime" placeholder="结束时间"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">满</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="coupon.moneyFull" placeholder="满"/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">减</div>
			   	<div class="col-sm-10">
			      <input type="text" class="form-control" v-model="coupon.moneyReduce" placeholder="减"/>
			    </div>
			</div>
			
			<div class="form-group">
				<div class="col-sm-2 control-label">发放人</div>
				<div class="col-sm-10">
					<div>
						<img width="50px" height="50px" style="margin-right: 5px; border-radius: 50%" v-for="user in userList" alt="" :src="user.avatarUrl">
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
		</div>
		</div>
	</div>
	
	</section>
	</div>
</div>

<script src="../../js/modules/oms/coupon.js?_t=1"></script>
<script type="text/javascript">
$(function(){
	$('#end').datetimepicker({
		language: 'zh-CN',
		minView: "month",
		autoclose:true,
		format : 'yyyy-mm-dd'
	});
	$('#start').datetimepicker({
		language: 'zh-CN',
		minView: "month",
		autoclose:true,
		format : 'yyyy-mm-dd'
	});
})
</script>
</body>
</html>